package com.entity.def;

import com.ymx.darling.util.StringUtil;
import com.ymx.darling.wrapper.fragment.TableInfo;

public class OrdersDef implements TableInfo {
	private static final String TABLE_NAME = "orders";

	public static final OrdersDef orders = OrdersDef.as("");

	private final String currentTableName;

	private final String aliaName;

	public final String created_at;

	public final String updated_by;

	public final String is_deleted;

	public final String product_id;

	public final String created_by;

	public final String id;

	public final String user_id;

	public final String updated_at;

	public final String[] default_columns;

	private OrdersDef(String aliaName) {
		this.aliaName = aliaName;
		if (StringUtil.isNull(aliaName)) {
			aliaName = TABLE_NAME;
			currentTableName = TABLE_NAME;
		} else {
			currentTableName = TABLE_NAME + " AS " + aliaName;
		}
		this.created_at = aliaName + "." + "created_at";
		this.updated_by = aliaName + "." + "updated_by";
		this.is_deleted = aliaName + "." + "is_deleted";
		this.product_id = aliaName + "." + "product_id";
		this.created_by = aliaName + "." + "created_by";
		this.id = aliaName + "." + "id";
		this.user_id = aliaName + "." + "user_id";
		this.updated_at = aliaName + "." + "updated_at";
		this.default_columns = new String[]{created_at, updated_by, is_deleted, product_id, created_by, id, user_id, updated_at};
	}

	public static OrdersDef as(String aliaName) {
		return new OrdersDef(aliaName);
	}

	@Override
	public String getTableName() {
		return this.currentTableName;
	}

	@Override
	public String getAliaName() {
		return this.aliaName;
	}

}